<?php
Yii::app()->clientScript->registerScriptFile((Yii::app()->baseUrl) . '/vendor/ckeditor/ckeditor.js', CClientScript::POS_HEAD);
?>
<div class="row-fluid sortable">		
    <div class="box span12">
        <div class="box-header" data-original-title>
            <h2><i class="icon-user"></i><span class="break"></span><strong>Chỉnh sửa ý tưởng: </strong><?php echo $YTuong->TieuDe; ?></h2>
            <div class="box-icon">
                <a href="#" class="btn-setting"><i class="fa-icon-wrench"></i></a>
                <a href="#" class="btn-minimize"><i class="fa-icon-chevron-up"></i></a>
                <a href="#" class="btn-close"><i class="fa-icon-remove"></i></a>
            </div>
        </div>
        <div class="box-content">
            <?php
            $form = $this->beginWidget('CActiveForm', array(
                'id' => 'edit-idea-form',
                'enableAjaxValidation' => true,
                'htmlOptions' => array('enctype' => 'multipart/form-data', 'role' => 'form'),
                'clientOptions' => array(
                    'validateOnSubmit' => true,
                ),
            ));
            ?>
            <div class="controls">
                <label class="control-label" for="prependedInput">Tiêu đề</label>
                <?php echo $form->textField($YTuong, 'TieuDe', array('class' => 'span10')); ?>
                <span class="errorMessage"><?php echo $form->error($YTuong, 'TieuDe'); ?></span>
            </div>
            <div class="control-group">
                <label class="control-label" for="prependedInput">Giới thiệu</label>
                <?php echo $form->textArea($YTuong, 'GioiThieu', array('class' => 'span10')); ?>
                <span class="errorMessage"><?php echo $form->error($YTuong, 'GioiThieu'); ?></span>
            </div>
            <div class="control-group">
                <label class="control-label" for="prependedInput">Nguồn</label>
                <?php echo $form->textField($YTuong, 'Nguon', array('class' => 'span10')); ?>
                <span class="errorMessage"><?php echo $form->error($YTuong, 'Nguon'); ?></span>
            </div>
            <div class="control-group">

                <label class="control-label" for="prependedInput">Ảnh bìa</label>
                <?php echo CHtml::activeFileField($YTuong, 'AnhBia', array('class' => 'form-control')); ?>
                <span class="errorMessage"><?php echo $form->error($YTuong, 'AnhBia'); ?></span>

                <img width="100" src="<?php echo Yii::app()->baseUrl . '/images/ArticleCover/' . $YTuong->AnhBia; ?>"/>

            </div>
            <div class="control-group">
                <label class="control-label" for="prependedInput">Nội dung</label>
                <?php echo $form->textArea($YTuong, 'NoiDung', array('class' => 'form-control', 'id' => 'NoiDung')); ?>
                <span class="errorMessage"><?php echo $form->error($YTuong, 'NoiDung'); ?></span>
            </div>
            <a onclick="history.go(-1)" class="btn">Trở về</a>
            <?php echo CHtml::submitButton('Lưu thay đổi', array('class' => 'btn btn-primary')); ?>
            <?php $this->endWidget(); ?>
        </div>
    </div>
</div>
<script>
    $(document).ready(function() {
        CKEDITOR.replace('NoiDung',{height: 500});
    });
</script>